package com.link.ppt.Api;

import com.link.ppt.Model.Bean.BaseBean;
import com.link.ppt.Model.Bean.ExpertFieldBean;
import com.link.ppt.Model.Bean.PersonalInfoBean;
import com.link.ppt.Model.Bean.SimpleUserInfoBean;

import java.util.HashMap;
import java.util.Map;

import okhttp3.RequestBody;
import retrofit2.http.FieldMap;
import retrofit2.http.FormUrlEncoded;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.PartMap;
import rx.Observable;

/**
 * Created by liucxu on 2017/7/11.
 */

public interface UserService {

    /**
     * 获取登录验证码
     * @param params
     * @return
     */
    @FormUrlEncoded
    @POST("user.do")
    Observable<BaseBean> GetVerificationCode(@FieldMap HashMap<String, String> params);


    /**
     * 使用手机验证码登录
     * @param params
     * @return
     */
    @FormUrlEncoded
    @POST("user.do")
    Observable<SimpleUserInfoBean> LoginByCode(@FieldMap HashMap<String, String> params);

    /**
     * 用户注册
     * @param params
     * @return
     */
    @Multipart
    @POST("user.do")
    Observable<SimpleUserInfoBean> RegisterUser(@PartMap Map<String, RequestBody> params);

    @FormUrlEncoded
    @POST("user.do")
    Observable<ExpertFieldBean> requestIndustry(@FieldMap HashMap<String, String> params);

    @FormUrlEncoded
    @POST("user.do")
    Observable<PersonalInfoBean> RequestUserInfo(@FieldMap HashMap<String, String> params);



    /**
     * 更改用户信息
     * @param params
     * @return
     */
    @Multipart
    @POST("user.do")
    Observable<BaseBean> EditUserInfo(@PartMap Map<String, RequestBody> params);
}
